<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function __construct()
    {
        parent::__construct();
        if(!$this->session->userdata('is_logged_in')){
            redirect('admin/login');
        }
    }
 
    
	public function index()
	{
		$this->load->view('welcome_message');
		
	}
	
	///////////////////////////////////////////
	
    /////////////////////////////////////////////
	 function pdf()
		{
			 $this->load->helper(array('dompdf', 'file'));
			 // page info here, db calls, etc.     
						 
			 $html="<html>
						<head>
						<style>
						@page {
							margin: 120px 50px 80px 50px; 
						}
						#footer {
							position: fixed;
							bottom: -50px;
							height: 30px;
							background-color: #333399;
						}
						#header {
							position: fixed;
							top: -115px;
							width: 100%;
							height: 106px;
							background: url('http://localhost/CodeIgniter_214/resourse/images/header_left.jpg') no-repeat;
						}
						
						</style>
						</head>
						
						<body>
						
						<div id='header'>
							This is the header	</div>
						<div id='footer'>
							This is the footer
						</div>
						<div>
  <img src='http://localhost/CodeIgniter_214/resourse/images/bird.jpg' width='130' height='80' alt='Web Programming' />
						</div>
						<table  border='1'>
						<tr>
						<th>header1</th><th>header2</th><th>header3</th>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>2</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>51</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>52</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>45</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>48</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>49</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>50</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>51</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>52</td>
						<td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						<tr>
						<td>Column1</td><td>Column2</td><td>Column3</td>
						</tr>
						</table>
						<!-- Type some HTML here -->
						
						</body>
						</html>";
						
			 pdf_create($html, 'filename');
			  
		}	
	///////////////////////////////////////////
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */